<?php

namespace App\Api\Eloquent;

class GiftReceive extends Model
{
  /**
   * 实例化模型时, 可批量赋值属性白名单
   *
   * @var array
   */
  protected $fillable = [
    'activity_id', 'activity_cate','begin_time','end_time','user_id','input_time','use_time','money'
  ];
  public $timestamps = false;

  /**判断红包状态
   * @param $gift_ID
   * @param $status
   * @return bool
   */
  public static function verifStatus($gift_ID,$status){
    $gifts=GiftReceive::whereIn('id',$gift_ID)->get();
    foreach($gifts as $gift){
      if($gift->status!=$status){
        return false;
      }
    }
    return true;
  }
}